import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue';
// import Antd from 'ant-design-vue';
// import 'ant-design-vue/dist/antd.css';
import router from './router/pc/index.js';
import store from './vuex/index';
import $https from 'axios/index';
import filters from './filter/index';
import '@/utils/rem.js';
// import "lib-flexible/flexible.js";
Vue.use(ElementUI, { size: 'small' });
// Vue.use(Antd);
Vue.use(ElementUI);
Vue.prototype.$https = $https;
Vue.config.productionTip = false;
Vue.config.devtools = true;
// 循环Vue绑定filter
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});

// element 统一配置提示信息
// ['success', 'warning', 'info', 'error'].forEach(type => {
//   ElementUI.Message[type] = options => {
//     if (typeof options === 'string') {
//       options = {
//         message: options,
//         duration: 2000,
//         showClose: true
//       };
//     }
//     options.type = type;
//     return ElementUI.Message(options);
//   };
// });

/* eslint-disable no-new */
window.$VM = new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
});
